  
	<#include "../common/com.html"  /> <@layout>
<head>
    <!-- page specific plugin styles -->
    <link rel="stylesheet" href="${ctx}/static/assets/css/ui.jqgrid.css" />
    <!-- ace styles -->
    <script src="${ctx}/static/inc/platform/js/ajax.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/cbb/artDialog/skins/blue.css">
    <script src="${ctx}/static/cbb/artDialog/jquery.artDialog.js"></script>
</head>
    <script type="text/javascript">
    

  /**
     * 删除选中的模型信息
     */
    function dels(obj,yxbz){
            var url = '${ctx}/tbMeetClass/delete/';
            $("#id").attr("value",obj);
            $('#myform').form('submit', {
                url : url,
                onSubmit : function() {
                },
                success : function(data) {
                    // 回填页面
                    alert(data);
                    window.location.reload();
                }
            });
    }

    function cleankhid(){
  		$('#meettitle').val('');
  		$('#title').val('');
  	}
</script>
<body>

<div class="page-content">
	<div class="page-header" style="height: 15px">
    </div><!-- /.page-header -->
    
	 <div class="row-fluid">
        <div class="span12">
            <form class="form-inline" id="myform">
                <input type="hidden" name="id" id="id">
              	会议名称：<input type="text"  name="search_LIKE_meettitle" id="meettitle"   class="query"  style="min-height: 24px;width: 100px"  value="${(meettitle)!}"      />
                课程：<input type="text"  name="search_LIKE_title" id="title"   class="query"  style="min-height: 24px;width: 100px"  value="${(title)!}"      />
                
                <button id="search_btn" onclick="return false;" class="btn btn-info btn-small"  onclick="queryModel()">
                    <i class="icon-key bigger-110"></i>
                    查询
                </button>
                <a href="#"  class="btn btn-danger btn-small bigger-110"   onclick="cleankhid();">取消 </a>

            </form>
            <!-- PAGE CONTENT BEGINS -->
            <table id="grid-table"></table>
            <div id="grid-pager"></div>
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.span -->
    </div><!-- /.row-fluid -->
</div><!-- /.page-content -->
<!-- page specific plugin scripts -->


<#include  "../common/end.html"  /> 
<script>
    function add(){
        var url = '${ctx}/tbMeetClass/newModes' ;
        initArtDialog({url:url, title:'新增', width:600, height:400,lock:true,background: '#EAEAEA'});
    }
    /**
     * 编辑选中的模型信息
     */
    function edits(obj){
        var rowData = $("#grid-table").getRowData(obj);
        var  url = '${ctx}/tbMeetClass/newModes?id=' + rowData.id;
        initArtDialog({url:url, title:'修改', width:730, height:450,lock:true,background: '#EAEAEA'});
    }
</script>
<script type="text/javascript">

$("#search_btn").click(function(){

   // var start=$("#start").val();

    $("#grid-table").jqGrid('setGridParam',{
        datatype:'json',
        postData:{'search_LIKE_meettitle':$('#meettitle').val(),'search_LIKE_title':$('#title').val()  }, //发送数据 'search_LIKE_lrrq':start
        page:1
    }).trigger("reloadGrid"); //重新载入
});


jQuery(function($) {

    //  jqgrid
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";
    var start=$("#start").val();


    jQuery(grid_selector).jqGrid({
        datatype: "json", //将这里改为使用JSON数据
        mtype:"POST",
        postData:{}, //发送数据
        url:'${ctx}/tbMeetClass/query',
        height: '55%',
        footerrow:false,  //合计数据
        colNames:['操作 ', 
        	 '会议',  '课程题目','老师',  '开始时间',  '结束时间',  '费用',  '提成',   '地址',  ''],
        colModel:[
            {name:'edits',index:'',width:100,sortable:false, resizable:true,formatter: printthis},
		    {name:'meettitle', width:100,sortable:false},
		    {name:'title', width:100,sortable:false},
		    {name:'teachername', width:60,sortable:false},
		    {name:'starttime', width:120,sortable:false},
		    {name:'endtime', width:120,sortable:false},
		    {name:'feeclass', width:60,sortable:false},
		    {name:'feeperson', width:60,sortable:false},
		    {name:'cityname', width:100,sortable:false},
            {name:'id',index:'',hidden:true,width:50,sortable:false}
        ],
        rownumbers:true,//添加左侧行号
        sortname: 'id',
        sortable: false,
        viewrecords: true, //是否显示行数
        rowNum:20,
        rowList:[10,20,30],
        loadtext: '正在加载数据...',
        loadui : 'block',
        pager : pager_selector,
        altRows: true,
        shrinkToFit: true,
        //toppager: true,
//
//        multiselect: true,
//        //multikey: "ctrlKey",
//        multiboxonly: true,

       loadComplete : function() {
            var table = this;
            setTimeout(function(){
                updatePagerIcons(table);
            },
                    0);
        } ,
//        ondblClickRow: openview,
//
        caption: "课程管理 <input type='button' onclick='add()'  class='btn btn-mini btn-danger' value='新增'> " ,
        autowidth: true
    });
        //按钮
        function printthis(cellvalue,options,rowObject){
            var ids=rowObject.id;
            var yxbz =rowObject.spbz;
            var buttomHtml= "<a class='green' href=\"javascript:edits('" + ids + "','" + yxbz + "')\" title='修改'><i class='icon-pencil bigger-130'></i>修改</a> &nbsp;&nbsp;" +
                    "<a class='red' href=\"javascript:dels('" + ids + "','" + yxbz + "')\" title='删除'><i class='icon-trash  bigger-130'></i>删除</a> </div> ";

//            var buttomHtml="<a href='#' class='btn btn-primary btn-mini ' onclick='opennew()'><i class='icon-print  bigger-125  '>打印</i>  </a>";
            return buttomHtml
        }


        function  openview(rowid,iRow,iCol,e){
            url = '${ctx}/tbMeetClass/view?id=' + rowid;
            initArtDialog({url:url, title:'查看', width:500, height:280,lock:true,background: '#EAEAEA'});
        }
        
    });

  
  
    
    //replace icons with FontAwesome icons like above
    function updatePagerIcons(table) {
        var replacement =
        {
            'ui-icon-seek-first' : 'icon-double-angle-left bigger-150',
            'ui-icon-seek-prev' : 'icon-angle-left bigger-150',
            'ui-icon-seek-next' : 'icon-angle-right bigger-150',
            'ui-icon-seek-end' : 'icon-double-angle-right bigger-150'
        };
        $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
            var icon = $(this);
            var $class = $.trim(icon.attr('class').replace('ui-icon', ''));

            if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
        })
    }

    function enableTooltips(table) {
        $('.navtable .ui-pg-button').tooltip({container:'body'});
        $(table).find('.ui-pg-div').tooltip({container:'body'});
    }

    //var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');

//    $( "#adds" ).on('click', function(e) {
//        e.preventDefault();
//        addr();
//    });


window.onresize = function  _doResize() {
    var ss = pageSize();
    $("#grid-table").jqGrid('setGridWidth', ss.WinW-10).jqGrid('setGridHeight', ss.WinH-200);
}

function pageSize() {
    var winW, winH;
    if(window.innerHeight) {// all except IE
        winW = window.innerWidth;
        winH = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {// IE 6 Strict Mode
        winW = document.documentElement.clientWidth;
        winH = document.documentElement.clientHeight;
    } else if (document.body) { // other
        winW = document.body.clientWidth;
        winH = document.body.clientHeight;
    }  // for small pages with total size less then the viewport
    return {WinW:winW, WinH:winH};
}

//select2查询列表每次只查数据的前20条



</script>

</body>
 </@layout> 
